home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2344 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: winternet.com!not-for-mail
  2. From: jdege@winternet.com (Jeff Dege)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: 17 Jan 1996 01:44:46 GMT
  6. Organization: StarNet Communications, Inc
  7. Message-ID: <4dhkae$an9@blackice.winternet.com>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd3ga$80a@beatty.slip.netcom.com> <dewar.819643725@schonberg> <4bhe6u$adq@beatty.slip.netcom.com> <dewar.819838019@schonberg> <4bv1ce$co1@ixnews4.ix.netcom.com> <4dh0b0$10si@pulp.ucs.ualberta.ca>
  9. NNTP-Posting-Host: klondike.winternet.com
  10. X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
  11.  
  12. On 16 Jan 1996 20:03:44 GMT, Darin McBride (mcbride@ee.ualberta.ca) wrote:
  13. : Well, first, as a disclaimer, we used adt's (classes, structs, etc.) as
  14. : base types.  But we still found use in using the 'm_lLongVar' style
  15. : since we had to use sprintf alot (in real-time data-gathering, sometimes
  16. : the overhead of strstream was prohibitive).  So was that a %d, %u, %ld,
  17. : %lu... or %s?  
  18.  
  19.     Generally speaking, when I use printf(), et al., with integer types
  20. of uncertain or unknown size, I explicitly cast.  i.e.:
  21.  
  22. printf("The current epoch is %ld\n", (long) time(NULL));
  23.  
  24.     This is, as far as I know, the only safe way to printf() a time_t, 
  25. size_t, etc.
  26.  
  27. -- 
  28.         "I quite agree with you," said the Duchess; "and the moral of
  29. that is -- `Be what you would seem to be' -- or, if you'd like it put
  30. more simply -- `Never imagine yourself not to be otherwise than what it
  31. might appear to others that what you were or might have been was not
  32. otherwise than what you had been would have appeared to them to be
  33. otherwise.'"
  34.                 -- Lewis Carrol, "Alice in Wonderland"
  35.  
  36.  
  37.